import java.util.List;

public class noibr {
package com.example.demo.guilei;

import com.example.demo.guilei.BookDao;
import com.example.demo.guilei.BookInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
    @Component
    public class BookService {
        @Autowired
        BookDao bookDao;
        public List<BookInfo> getBookList() {
            List<BookInfo> books = bookDao.mockData();
            for (BookInfo book : books) {
                if (book.getStatus() == 1) {
                    book.setStatusCN("可借阅");
                } else {
                    book.setStatusCN("不可借阅");
                }
            }
            return books;
        }
    }


}
